package com.mengma.ec.dao;

import com.mengma.ec.entity.Cart;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface CartMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Cart record);

    int insertSelective(Cart record);

    Cart selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Cart record);

    int updateByPrimaryKey(Cart record);

    List<Cart> findListByUserId(@Param("userId") Integer userId);

    int findCheckCount(Integer userId);

    Cart findCartByUserIdAndProductId(@Param("userId") Integer userId, @Param("productId") Integer productId);

    int updateQuantityByProductIdAndUserId(@Param("userId") Integer userId, @Param("productId") Integer productId, @Param("count") Integer count);

    int deleteByproductIds(@Param("userId") Integer userId, @Param("split") String[] split);

    List<Cart> findCartByUserIdAndChecked(Integer id);
}